var status = -1;
var selectionLog = [];

function start() {
    action(1, 0, 0)
}

function action(d, c, b) {
    if (status == 0 && d == 0) {
        im.dispose();
        return
    }(d == 1) ? status++ : status--;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        im.dispose()
    } else {
        if (status === a++) {
            im.gainItem(im.getItemId(), -1);
            im.gainItem(3015003, 1);
            im.gainItem(3015155, 1);
            im.gainItem(3015367, 1);
            im.gainItem(1004336, 1);
            im.gainItem(1004140, 1);
            im.gainItem(1052852, 1);
            im.gainItem(1102766, 1);
            im.gainItem(1052576, 1);
            im.gainItem(2433167, 1);
            im.gainItem(1702400, 1);
            im.gainItem(1702859, 1);
            im.gainItem(1072783, 1);
            im.gainItem(5000986, 1);
            im.gainItem(1802673, 1);
            im.dispose()
        }
    }
};